package com.wang.experiment.experiment1;

import java.util.*;

/**
 * @author wr
 * @date 2021/10/10 16:35
 */
public class Experiment1 {
    public static void main(String[] args) {
        three();
    }

    public static Scanner in = new Scanner(System.in);

    public static void one() {
        int n = in.nextInt();
        double ans = 0;
        for (int i = 1; i <= n; i++) {
            ans += 1.0 / ((1 << i) - 1);
        }
        System.out.println(ans);
    }

    public static void two() {
        int m = in.nextInt();
        int n = in.nextInt();
        int gcd = gcd(m, n);
        System.out.println("gcd:" + gcd + ", lcm:" + m / gcd * n);
    }

    private static int gcd(int m, int n) {
        return n > 0 ? gcd(n, m % n) : m;
    }

    public static void three() {
        for (int i = 100; i < 1000; i++) {
            int a = i / 100;
            int b = i % 100 / 10;
            int c = i % 10;
            if (a * a * a + b * b * b + c * c * c == i) {
                System.out.print(i + " ");
            }
        }
        System.out.println("");
    }

    public static void four() {
        int n = in.nextInt();
        for (int i = 1; i <= n; i++) {
            int sum = 1;
            for (int j = 2; j < i; j++) {
                if (i % j == 0) {
                    sum += j;
                }
            }
            if (sum == i) {
                System.out.print(i + " ");
            }
        }
        System.out.println("");
    }

    public static void five() {
        int n = in.nextInt();
        //素数筛
        boolean[] notPrime = new boolean[n + 1];
        notPrime[0] = notPrime[1] = true;
        for (int i = 2; i <= n; i++) {
            //若是素数
            if (!notPrime[i]) {
                //划去所有它的倍数
                int temp = i * 2;
                while (temp <= n) {
                    notPrime[temp] = true;
                    temp += i;
                }
            }
        }

        for (int i = 1; i <= n; i++) {
            if (!notPrime[i]) {
                System.out.print(i + " ");
            }
        }
        System.out.println("");
    }

    public static void six() {
        //桶计数
        int[] num = new int[101];
        for (int i = 0; i < 1000; i++) {
            num[(int) (Math.random() * 100) + 1]++;
        }
        for (int i = 1; i <= 100; i++) {
            if (num[i] != 0) {
                System.out.printf("%d:%d ", i, num[i]);
            }
        }
    }

    public static void seven() {
        int min = in.nextInt();
        int max = in.nextInt();
        int n = in.nextInt();
        List<Integer> list = new ArrayList<>();
        //将min-max的所有数加入数组
        for (int i = min; i <= max; i++) {
            list.add(i);
        }
        //打乱数组
        Collections.shuffle(list);
        //输出前n个
        for (int i = 0; i < n; i++) {
            System.out.print(list.get(i) + " ");
        }
    }

    public static void eight() throws Exception {
        int m1 = in.nextInt();
        int n1 = in.nextInt();
        int[][] arr1 = new int[m1][n1];
        for (int i = 0; i < m1; i++) {
            for (int j = 0; j < n1; j++) {
                arr1[i][j] = in.nextInt();
            }
        }
        int m2 = in.nextInt();
        int n2 = in.nextInt();
        int[][] arr2 = new int[m2][n2];
        for (int i = 0; i < m2; i++) {
            for (int j = 0; j < n2; j++) {
                arr2[i][j] = in.nextInt();
            }
        }
        if (n1 != m2) {
            throw new Exception("invalid arr");
        } else {
            int[][] ans = new int[m1][n2];
            for (int i = 0; i < m1; i++) {
                for (int j = 0; j < n2; j++) {
                    for (int k = 0; k < n1; k++) {
                        ans[i][j] += arr1[i][k] * arr2[k][j];
                    }
                }
            }
            for (int i = 0; i < m1; i++) {
                for (int j = 0; j < n2; j++) {
                    System.out.print(ans[i][j] + " ");
                }
                System.out.println("");
            }
        }
    }
}
